package cn.jtfadmin.sysmonitor.controller;

import cn.jtfadmin.base.lang.common.domain.dto.ResultDTO;
import cn.jtfadmin.sysmonitor.domain.dto.FileSystemDTO;
import cn.jtfadmin.sysmonitor.domain.dto.OperatingSystemInfoDTO;
import cn.jtfadmin.sysmonitor.service.SystemInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 服务器系统监控
 * @author jtf
 * @since 0.0.2
 */
@RestController
public class SystemMonitorController {


    @Autowired
    private SystemInfoService service;

    /**
     * 获取操作系统信息
     * @return 磁盘信息
     */
    @GetMapping(value = "/monitor/operatingSystem/getInfo")
    public ResultDTO<OperatingSystemInfoDTO> getOperatingSystemInfo(){
        return ResultDTO.successData(service.getOperatingSystemInfo());
    }


    /**
     * 获取文件系统信息
     * @return 文件系统信息
     */
    @GetMapping(value = "/monitor/fileSystem/getInfo")
    public ResultDTO<FileSystemDTO> getFileSystem(){
        return ResultDTO.successData(service.getFileSystem());
    }


}
